package cn.tude.review;

//本类用于复习面相对像
public class Testoop {
    //程序入口main函数
    public static void main(String[] args) {
        //5.创建phone类对象
        Phone phone = new Phone();
        System.out.println(phone.getColor());
        //6.调用set方法对成员变量进行赋值
        phone.setColor("活力层");
        System.out.println(phone.getColor());
        //7.调用phone类的属性即方法
        phone.call();
    }
}

//1.phone类的封装
class Phone {
    //2属性成员变量
    private String brand;
    private double price;
    private double size;
    private String color;
//3属性的getset方法
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
//4行为-----方法
    public void call() {
        System.out.println("我正在打电话");

    }
}